package com.whjz.dcfs.jzxx.struts.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.whjz.dcfs.jzxx.dao.IDcfsSbTxjhfsJbxxDAO;
import com.whjz.dcfs.jzxx.model.DcfsSbTxjhfsJbxx;
import com.whjz.dcfs.util.BaseAction;

public class JZSBTXFSAction extends BaseAction{

	private static final long serialVersionUID = 1L;
	@Autowired
	public IDcfsSbTxjhfsJbxxDAO dcfsSbTxjhfsJbxxDAO;
	
	private DcfsSbTxjhfsJbxx dcfsSbTxjhfsJbxx;

	public DcfsSbTxjhfsJbxx getDcfsSbTxjhfsJbxx() {
		return dcfsSbTxjhfsJbxx;
	}

	public void setDcfsSbTxjhfsJbxx(DcfsSbTxjhfsJbxx dcfsSbTxjhfsJbxx) {
		this.dcfsSbTxjhfsJbxx = dcfsSbTxjhfsJbxx;
	}
	
	public void getDcfsSbTxjhfsJbxxListByCond() throws Exception{
		getHttpServletResponse().setCharacterEncoding("utf-8");
		List<DcfsSbTxjhfsJbxx> list=dcfsSbTxjhfsJbxxDAO.getDcfsSbTxjhfsJbxxListByCond(dcfsSbTxjhfsJbxx);
		StringBuffer sb=new StringBuffer();
		sb.append("{root:[");
		if(list!=null&&list.size()>0){
			for(int i=0;i<list.size();i++){
				sb.append("{");
				sb.append("JHFS_BH:'"+list.get(i).getJhfsbh()+"',");
				sb.append("JHFS_MC:'"+list.get(i).getJhfsmc()+"'");
				sb.append("}");
				if(i < list.size()-1){
					sb.append(",");
				}
			}
		}
	    sb.append("]}");
	    getHttpServletResponse().getWriter().println(sb);
	}
	
}
